<?php
/*
 +----------------------------------------------------------------------
 | TEMMOKUMVC [ NO BEST , ONLY BETTER ]
 +----------------------------------------------------------------------
 | Copyright (c) 2018~2019 https://www.temmoku.cn All rights reserved.
 +----------------------------------------------------------------------
 | Author: 张宗强 Email:webmaster@temmoku.cn QQ:158726877 516669373 TEL:17895221001 微信:temmokumvc
 +---------------------------------------------------------------------- 
*/
namespace plugin\sms\public_class;
use plugin\sms\init;
class send{
	static $setting=[];
	static $default=[];
	public function put($mobile='',$text='',$code=''){
		if(!c(init::$dir)){
			$dir=APP_PATH."plugin/sms/conf/";
			Load_conf($dir);
		}
		self::$setting=C(init::$dir.'|setting');
		self::$default=['initial_name'=>C(init::$dir.'|initial_name')];
		if(!self::$setting || self::$setting['is_close']=='0'){
			$array= ['code'=>'100','text'=>'模块暂未开启'];
		}else{
			
			if(!self::$default['initial_name']){
				$array= ['code'=>'999','text'=>'没有安装任何短信平台'];
			}else{
				if(!self::$default){
					$array=['code'=>'101','text'=>'没有选择默认的短信平台'];
				}else{
					$class="plugin\\sms\\vendor\\".self::$default['initial_name']."\\put";
					if(self::$default['setting']){
						$setting=unserialize(stripslashes(self::$default['setting']));
					}
					$array=(new $class)->put($mobile,$text,$code,$setting);
				}
			}
			
		}
		return $array;
	}
	
}
?>